x11: emit ::enter/leave-monitor
authorOlivier Fourdan <ofourdan@redhat.com>
Thu, 16 Apr 2020 10:58:39 +0000 (12:58 +0200)
committerOlivier Fourdan <ofourdan@redhat.com>
Thu, 16 Apr 2020 14:23:57 +0000 (16:23 +0200)
commit86f295f929f8ef05b135cfd56a72459808c65392
treef9649ec11dd60ed8b1d1163e4c32fea3e30f1f2b
parent3d988d5fe90b9f9b5f7c136c1a7c214c6ba37c1e
x11: emit ::enter/leave-monitor

For the X11 backend, keep a list of monitors for which the surface
intersects the monitor area.

Whenever the X11 surface is configured, check against the list of
monitors to determine whether it enters a new monitor or if it left a
monitor, to emit the corresponding ::enter/leave-monitor signals just
like a Wayland compositor would.

As monitors can be added, removed or reconfigured at any time, redo
those checks whenever any of these events occur.
gdk/x11/gdkdisplay-x11.c
gdk/x11/gdkprivate-x11.h
gdk/x11/gdksurface-x11.c
gdk/x11/gdksurface-x11.h